package com.hzw.saas.service.hpc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzw.saas.api.hpc.bo.HpcAccountBillBaseBO;
import com.hzw.saas.service.hpc.model.HpcAccountDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 用户机时明细表 Mapper 接口
 * </p>
 *
 * @author zzl
 * @since 2021-02-05
 */
@Mapper
public interface HpcAccountDetailMapper extends BaseMapper<HpcAccountDetail> {

    /**
     * 删除HPC明细数据，不走逻辑删除
     *
     * @param hpcAccountRecordId
     */
    @Delete("<script> delete from tb_hpc_account_detail where hpc_account_record_id=#{hpcAccountRecordId}  </script>")
    void deleteHpcDetailFromXmlByHpcRecordId(@Param("hpcAccountRecordId") String hpcAccountRecordId);

    /**
     * 获取账单区间内的用户HPC账户使用统计（含账单区间内过期的账户）
     *
     * @param providerType
     * @param startDate
     * @param endDate
     * @return
     */
    List<HpcAccountBillBaseBO> listHpcAccountByPeriod(@Param("providerType") String providerType, @Param("keyword") String keyword, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
}
